'use strict';
import React, {Component} from 'react';
import {Switch, Tag, Tooltip} from 'antd';
import styles from '../../index.less';
import {value} from "lodash/seq";

const _theme = require('../../theme');
export default class FieldSwitch extends Component {
  constructor(props) {
    super(props);

  }

  componentWillUnmount() {

  }

  getLevelColor(level) {
    switch (level) {
      case 0:
        return _theme['primary-color'];
      case 1:
        return _theme['primary-color-1'];
      case 2:
        return _theme['primary-color-2'];
      default:
        return _theme['primary-color'];
    }
  }

  /**
   *  <ul>
   <li>
   名称：{name}
   </li>
   <li>
   编码：{code}
   </li>
   </ul>
   * @returns {*}
   */
  render() {
    let {title, checkedChildren = '是', unCheckedChildren = '否', defaultChecked, onSwitch} = this.props;
    return (
      <tbody>
      <tr>
        <td>{title}</td>
        <td style={{marginLeft:'6px'}}>
          <Switch style={{marginLeft:'6px'}} checkedChildren={checkedChildren} unCheckedChildren={unCheckedChildren}
                    defaultChecked={defaultChecked}
                    onChange={value => onSwitch(value)}></Switch></td>
      </tr>
      </tbody>
    );
  }
}
